﻿// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// See License.txt in the project root for license information.
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;

namespace ActorFramework.Fakebook
{
    [Serializable]
    public class PictureInfo
    {
        [ContractInvariantMethod]
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Required for code contracts.")]
        private void ObjectInvariant()
        {
            Contract.Invariant(this.Title != null);
        }


        public PictureInfo(String title, byte[] imageBytes, String originalUri, String author, String licenseName, String licenseUri)
        {
            Contract.Requires(!String.IsNullOrEmpty(title));
            //Contract.Requires(imageBytes != null);  JSON deserializer calls this method and passes in all the right fields, except image bytes.  Sets it later, since it's public.

            Title = title;
            ImageBytes = imageBytes;
            OriginalUri = originalUri;
            Author = author;
            LicenseName = licenseName;
            LicenseUri = licenseUri;
        }

        public String Title { get; private set; }

        public byte[] ImageBytes { get; set; }

        public String OriginalUri { get; private set; }

        public String Author { get; private set; }

        public String LicenseName { get; private set; }

        public String LicenseUri { get; private set; }
    }
}
